
const fs = require("fs");

class FileUtil {

      writeJsonToFile(fileDirector, fileName, json) {
        if(json instanceof Object) {
            fs.writeFileSync(fileDirector + '/' + fileName, JSON.stringify(json));
        } else {
            fs.writeFileSync(fileDirector + '/' + fileName, json);
        }
    }

     mkdir(path) {
        if(!fs.existsSync(path)){
            fs.mkdirSync(path);
        }
    }

}

module.exports = FileUtil;